﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CoroutineDeemo1 : MonoBehaviour
{

    private void Start()
    {
       // StartCoroutine(Fun());//不能被停止
        StartCoroutine("Fun");//可以被停止

    }
    private void Update()
    {
        Debug.Log("updata");
    }
    //定义一个协同程序
    IEnumerator Fun()
    {
        Debug.Log("1");
        yield return null;
        Debug.Log("2");
        yield return null;
        Debug.Log("3");
        yield return null;
    }
}
